import { defineConfig } from 'vitepress'
import { withPwa } from '@vite-pwa/vitepress'
import { version } from '../../package.json'
import { components, guides, navComponents } from './items'
import { pwa } from './scripts/pwa'

// https://vitepress.dev/reference/site-config
export default withPwa(defineConfig({
  title: '@enjoy/mobile',
  description: '@enjoy/mobile 移动端组件库',
  lastUpdated: true,
  appearance: 'light' as any,
  head: [
    ['meta', { property: 'og:title', content: '@enjoy/mobile' }],
    ['meta', { property: 'og:description', content: '@enjoy/mobile 移动端组件库，适配uni-app' } ],
    ['meta', { property: 'og:url', content: 'https://git.enjoyitcloud.com/FrontEnd/gym' }],
    ['meta', { name: 'referrer', content: 'no-referrer' }],
    ['link', { rel: 'icon', href: '/icon.png', type: 'image/png' }],
  ],
  themeConfig: {
    logo: '/icon.png',
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: '指南', items: guides },
      { text: '组件', items: navComponents },
      {
        text: `v${version}`,
        link: '',
      },
    ],

    search: {
      provider: 'local',
    },
    sidebar: {
      '/guide/': [
        {
          text: '指南',
          items: [
          ]
        }
      ],
      '/components/': [
        {
          text: '组件',
          items: components,
        },
      ],
    },
    footer: {
      message: 'MIT Licensed',
      copyright: 'Copyright &copy; 2007-2024 深圳市昂捷信息技术股份有限公司 · 版权所有',
    },
    aside: false,
    returnToTopLabel: 'top',
  },
  markdown: {
    theme: {
      light: 'vitesse-light',
      dark: 'vitesse-dark',
    },
  },
  pwa,
}))
